﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XingFuStudio.Pioneer.Net;
using XingFuStudio.Pioneer.Entity;
using XingFuStudio.Pioneer.Applications.City.Config;
using XingFuStudio.Pioneer.Applications.City.Entity;

namespace XingFuStudio.Pioneer.Applications.City.Operation {
    /// <summary>
    /// 操作工厂
    /// </summary>
    public static class OPFactory {

        /// <summary>
        /// 创建操作对象
        /// </summary>
        /// <param name="config"></param>
        /// <param name="httpManager"></param>
        /// <param name="account"></param>
        /// <param name="city"></param>
        /// <returns></returns>
        public static OPBase CreateOperate(UserConfigSection config, 
            HttpManager httpManager, AccountInfo account, CityInfo city) {

            switch (config.OPName) {
                case "Business":
                    return new Business(httpManager, account, city, config);
                case "Franchise":
                    return new Franchise(httpManager, account, city, config);
                case "Residence":
                    return new Residence(httpManager, account, city, config);
                case "Agriculture":
                    return new Agriculture(httpManager, account, city, config);
                case "Ship":
                    return new Ship(httpManager, account, city, config);
                case "Factory":
                    return new Factory(httpManager, account, city, config);
                case "Gift":
                    return new Gift(httpManager, account, city, config);
                case "Oilwell":
                    return new Oilwell(httpManager, account, city, config);
                case "Infrastructure":
                    return new Infrastructure(httpManager, account, city, config);
                case "Temporary":
                    return new OPTemporary(httpManager, account, city, config);
                case "Friend":
                    return new Friend(httpManager, account, city, config);
                case "Train":
                    return new Train(httpManager, account, city, config);
                case "Execute":
                    return new Execute(httpManager, account, city, config);
                case "Gray":
                    return new Gray(httpManager, account, city, config);
                default:
                    return null;
            }
        }
    }
}
